﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

using Login;
using RoomBookingManagement;
using Check_out;
using RoomBooking;
using StaffManagement;
using ServiceRegister;

namespace MainMenu
{
    public partial class MainMenu : Form
    {
        Login.Login m_loginForm;

        public MainMenu(Login.Login loginForm)
        {
            InitializeComponent();

            m_loginForm = loginForm;
            roomBooking.Visible = false;
            roomBookingManage.Visible = false;
            serviceRegistrating.Visible = false;
            checkingOut.Visible = false;
            customerManage.Visible = false;
            staffManage.Visible = false;
            serviceManage.Visible = false;
            roomManager.Visible = false;
        }

        private void openParent(object sender, FormClosedEventArgs e)
        {
            m_loginForm.Show();
        }

        private void openRoomBookingManagementForm(object sender, EventArgs e)
        {
            RoomBookingManagement.RoomBookingManagement form = new RoomBookingManagement.RoomBookingManagement();
            form.Show();
        }

        private void checkOut(object sender, EventArgs e)
        {
            Check_out.Check_out form = new Check_out.Check_out();
            form.Show();
        }

        public void activatePermision(int permitsionLevel)
        {
            if (permitsionLevel > 0)
            {
                roomBooking.Visible = true;
                checkingOut.Visible = true;
                serviceRegistrating.Visible = true;
                roomBookingManage.Visible = true;
                if (permitsionLevel > 1)
                {
                    roomManager.Visible = true;
                    serviceManage.Visible = true;
                    if (permitsionLevel > 2)
                    {
                        customerManage.Visible = true;
                        staffManage.Visible = true;
                    }
                }
            }
        }

        private void thoátToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void booking(object sender, EventArgs e)
        {
            RoomBooking.RoomBooking form = new RoomBooking.RoomBooking();
            form.Show();
        }

        private void roomManage(object sender, EventArgs e)
        {
            RoomManagement.RoomManagement form = new RoomManagement.RoomManagement();
            form.Show();
        }


        private void staffManaging(object sender, EventArgs e)
        {
            StaffManagement.StaffManagement form = new StaffManagement.StaffManagement();
            form.Show();
        }

        private void serviceRegistration(object sender, EventArgs e)
        {
            ServiceRegister.ServiceRegister form = new ServiceRegister.ServiceRegister();
            form.Show();
        }
    }
}
